<div id="active-manage-view">
  <div class="pageheader">
    <h2><i class="fa fa-home"></i>活动管理</h2>
    <!--<div class="al-header-right">-->
      <!--<button type="button" class="btn btn-primary" ng-click="newData()">新建品牌</button>-->
    <!--</div>-->
  </div>
  <div class="page">
    <div class="al-list-container">
      <form class="form-horizontal al-search-container" role="form">
        <div class="form-group">
          <label class="col-sm-2 control-label">活动类型</label>
          <div class="col-sm-2">
            <select class="form-control" ng-model="search.type"
                    ng-options="option.code as option.name for option in activeTypeList"></select>
          </div>
          <label class="col-sm-2 control-label">活动名称</label>
          <div class="col-sm-2">
            <input class="form-control" ng-model="search.filter" type="text" placeholder=""/>
          </div>
          <label class="col-sm-2 control-label">状态</label>
          <div class="col-sm-2">
            <select class="form-control" ng-model="search.status"
            ng-options="option.value as option.name for option in activeStatusList"></select>
          </div>
        </div>
        <div class="form-group">
          <div class="col-sm-8"></div>
          <div class="col-sm-2">
            <button type="button" ng-click="queryData()" class="btn btn-success al-float-right">查询</button>
          </div>
          <div class="col-sm-2">
            <button type="button" ng-click="resetSearch()" class="btn btn-default">重置</button>
          </div>
        </div>
      </form>
      <table ng-table="tableParams"
             class="table  table-bordered table-striped table-condensed al-table-container">
        <thead>
        <tr>
          <td>活动类型</td>
          <td>名称</td>
          <td>发起方</td>
          <td>活动地址</td>
          <td>收费类型</td>
          <td>报名费用</td>
          <td>状态</td>
          <td>操作</td>
        </tr>
        </thead>
        <tbody>
        <tr ng-repeat="item in $data">
          <td>{{showActiveType(item.type)}}</td>
          <td>{{item.name}}</td>
          <td>{{item.organizer}}</td>
          <td>{{item.address}}</td>
          <td>{{item.needFee|constantTransfer:costTypeList}}</td>
          <td>{{item.enterFee}}</td>
          <td>{{item.status|constantTransfer:activeStatusList}}</td>
          <td>
            <button class="btn btn-primary btn-sm" ng-click="viewData(item)">查看</button>
            <button class="btn btn-warning btn-sm" ng-if="item.status==0" ng-click="verifyData(item)">审批</button>
            <button class="btn btn-info btn-sm" ng-if="item.status==1" ng-click="startActive(item)" ng-confirm-click="确认开启活动吗?">开启</button>
            <button class="btn btn-danger btn-sm" ng-if="item.status==2" ng-click="endActive(item)" ng-confirm-click="确认结束活动吗？">结束</button>
            <!--<button class="btn btn-danger btn-sm" ng-click="removeData(item)">删除</button>-->
          </td>
        </tr>
        </tbody>
      </table>
    </div>
  </div>
</div>
